3af837b05b37c02900e4fd64a39dce0078f3d7e9,microservice-vote/vote-service-application/src/main/java/com/ibm/ws/microprofile/sample/conference/vote/api/SessionRatingListProvider.java,SessionRatingListProvider,isReadable,#Class#Type#Annotation[]#MediaType#,56
Before Change
@Override
public boolean isReadable(Class<?> clazz, Type type, Annotation[] annotations, MediaType mediaType) {
if (isDebugEnabled()) System.out.println("SRLP.isReadable() clazz=" + clazz + " type=" + type + " annotations=" + annotations + " mediaType=" + mediaType + " ==> " + clazz.equals(SessionRating.class));
return List.class.equals(clazz);
}
@Override
After Change
@Override
public boolean isReadable(Class<?> clazz, Type type, Annotation[] annotations, MediaType mediaType) {
boolean isReadable = List.class.isAssignableFrom(clazz);
if(isReadable && type instanceof ParameterizedType){
ParameterizedType paramType = (ParameterizedType) type;
Type[] actualTypes = paramType.getActualTypeArguments();
if(actualTypes.length == 1){
isReadable = actualTypes[0] == SessionRating.class;
}
}
if (isDebugEnabled()) System.out.println("SRLP.isReadable() clazz=" + clazz + " type=" + type + " annotations=" + annotations + " mediaType=" + mediaType + " ==> " + clazz.equals(SessionRating.class));
return isReadable;
}
@Override